from django.conf.urls import url
from cwd_articles import views, viewss

from rest_framework import routers

urlpatterns = [
    # 文章频道列表
    url(r'^channels/$', views.ChannelView.as_view()),
    # url(r'^article/(?P<id>\d+)/channel/$', views.wenzhangView.as_view())

]
from rest_framework.routers import SimpleRouter

router = SimpleRouter()
router.register(r'article', views.ArticleViewSet, basename='article')
urlpatterns += router.urls
# 文章搜索
router.register(r'articles/search', views.ArticleSearchViewSet, basename='article_search')
urlpatterns += router.urls
"=================================================================="
#
# router = routers.SimpleRouter()
# router.register(r'article', viewss.ArticleViewSet, base_name='article')
# urlpatterns = [
#     url(r'^channels/$', viewss.ChannelsViews.as_view({'get': 'list'})),
#     url(r'^labels/$', viewss.LabelsViews.as_view({'get': 'list'})),
#     url(r'^upload/avatar/$', viewss.UploadViews.as_view()),
#     url(r'^articles/search/$', viewss.SearchViews.as_view({'get': 'list'})),
#     # url(r'^article/(?P<id>\d)/channel/', views.AcView.as_view({'get': 'list'})),
# ]